<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link rel="stylesheet" type="text/css" href="/misc/css/base.css"  />
<link rel="stylesheet" type="text/css" href="/misc/css/btnicon.css"  />
<link rel="stylesheet" type="text/css" href="/misc/css/reset_admin.css"  />
<link rel="stylesheet" type="text/css" href="/misc/css/adminmenu.css"  />
<link rel="stylesheet" type="text/css" href="/misc/css/newadmin.css"  />
<script type="text/javascript" src="/misc/vendors/jquery/jquery_1.2.6.js"></script>
<script type="text/javascript" src="/misc/vendors/o2js/o2js.js"></script>
<script type="text/javascript" src="/misc/vendors/o2js/o2js_build.js"></script>
<script type="text/javascript" >
var baseUrl = "<?=$themeUrl?>";
</script>
</head>
<body   style="background-color:#fcfcfc;">
<style type="text/css">
.tables{
border-collapse:collapse;
color:#555555;
width:100%;
}
.tables th{
background-color:#E2F4C4;
}
.tables td,.tables th{
padding:5px;
vertical-align:top;
text-align:center;
border:1px solid #CCCCCC;
}
</style>
<div style="margin:10px">
	<table class="tables" >
		<thead>
			<tr>
				<th >菜品种类</th>
				<th >基地</th>
				<th >海拔</th>
				<th >采收人员</th>
				<th >采收质检员</th>
				<th >加工质检员</th>
			</tr>
		</thead>
		<tbody>
				<?PHP
				foreach($rs as $k=>$v){
					echo '
			<tr >
				<td>'.$v['type_name'].'</td>
				<td><input type="text" maxlength="100" id="pro_base_'.$v['id'].'" value="'.$v['pro_base'].'" /></td>
				<td><input type="text" maxlength="100" id="pro_height_'.$v['id'].'" value="'.$v['pro_height'].'" /></td>
				<td><input type="text" maxlength="100" id="pro_pickman_'.$v['id'].'" value="'.$v['pro_pickman'].'" /></td>
				<td><input type="text" maxlength="100" id="pro_testman_'.$v['id'].'" value="'.$v['pro_testman'].'" /></td>
				<td><input type="text" maxlength="100" id="make_testman_'.$v['id'].'" value="'.$v['make_testman'].'" /></td>
			</tr>
					';
				}
				?>
		</tbody>
	</table>
	<div class="button_div">
		<button onclick="fnSave()">保 存</button>
		<button onclick="fnReturn()">取 消</button>
	</div>
</div>
<script type="text/javascript">  
var rs = <?=json_encode($rs)?>;
var url_save = '/admin_srule/vegemodify';
$().ready(function(){
	showLoading();
});
function fnReturn(){
	parent.ymPrompt.close();
	parent.window.location.reload();
}
/* 保存 */
function fnSave(id){
	var forms  = [];
	for(var i=0; i< rs.length; i++){
		var id = rs[i].id;
		forms.push({
			id:id,
			pro_base:$('#pro_base_'+id).val(),
			pro_height:$('#pro_height_'+id).val(),
			pro_pickman:$('#pro_pickman_'+id).val(),
			pro_testman:$('#pro_testman_'+id).val(),
			make_testman:$('#make_testman_'+id).val()
		});
	}
	$.post(
		url_save,
		{
			forms:JSON.encode(forms)
		},
		function(e){
			var ok = errorHandler(e);
			if(ok && ok.success=='1'){
				alert('保存成功。');
				parent.ymPrompt.close();
				parent.window.location.reload();
			}
		}
	);
}
</script>
</body>
</html>